package sh.grapendaal.tsuushin.core;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * This class contains the configuration of a single IRC bot.
 */
public class BotInformation {
	private String nickname;
	private String username;
	private String realname;
	private String disconnectMessage;

	/**
	 * Returns the nickname of the bot.
	 * 
	 * @return The nickname of the bot.
	 */
	public String getNickname() {
		return nickname;
	}

	/**
	 * Sets the nickname of the bot. This is not the way to change a nickname of
	 * a connected bot. Use a NickMessage and send that to IRC instead.
	 * 
	 * @param nickname
	 *            The nickname to set.
	 */
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	/**
	 * Returns the username of the bot.
	 * 
	 * @return The username of the bot.
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * Sets the username of the bot. Note that you cannot change the username
	 * while connected to an IRC server.
	 * 
	 * @param username
	 *            The username to set.
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * Returns the real name of the bot. This shows up in a WHOIS command.
	 * 
	 * @return The real name of the bot.
	 */
	public String getRealname() {
		return realname;
	}

	/**
	 * Sets the real name of the bot as it will appear in a WHOIS command. Note
	 * that this cannot be changed while the bot is connected to an IRC server.
	 * 
	 * @param realname
	 *            The real name to set.
	 */
	public void setRealname(String realname) {
		this.realname = realname;
	}

	/**
	 * Returns the disconnect message the bot will use when it disconnects
	 * cleanly.
	 * 
	 * @return The disconnect message of the bot.
	 */
	public String getDisconnectMessage() {
		return disconnectMessage;
	}

	/**
	 * Sets the disconnect message of the bot when it disconnects cleanly.
	 * 
	 * @param disconnectMessage
	 *            The disconnect message to set.
	 */
	public void setDisconnectMessage(String disconnectMessage) {
		this.disconnectMessage = disconnectMessage;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this).append(this.nickname).append(this.username).append(this.realname)
				.append(this.disconnectMessage).toString();
	}
}
